<form action="" class="form-horizontal" role="form">

	<div class="form-group">
		<label class="col-sm-2 control-label">排序</label>
		<div class="col-sm-1">
			<input type="number" class="form-control" name="sort" placeholder="" datatype="n" value="{$houseType.sort}"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">户型名称</label>
		<div class="col-sm-3">
			<input type="text" class="form-control" name="name" placeholder="请填写户型名称，如A1户型" datatype="*" value="{$houseType.name}"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">户型简介</label>
		<div class="col-sm-5">
			<textarea class="form-control" name="description" rows="3" placeholder="请填写户型简介，例如三室两厅，110m²">{$houseType.description}</textarea>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">户型图</label>
		<div class="col-sm-5">
			<input type="text" class="form-control margin-bottom" id="pic" name="pic" placeholder="" readonly="readonly" value="{$houseType.pic}"/>
			<input type="file" id="image-upload" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">户型详情</label>
		<div class="col-sm-5">
			<script id="content" type="text/plain">{$houseType.content}</script>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">状态</label>
		<div class="col-sm-3">
			{$houseType.status}
		</div>
	</div>

	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			<input type="hidden" name="id" value="{$houseType.id}"/>
			<a class="btn btn-default" onclick="javascript:history.go(-1)">返回上页</a>
			<a class="btn btn-default" onclick="self.location=document.referrer">返回上页并刷新</a>
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save">保存更改</button>
		</div>
	</div>
</form>

<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
$(function() {
    $("#image-upload").uploadify({
        'multi'			:	false,
        'fileSizeLimit' : 	'200kb',
        'buttonText'	:	'选择图片',
        'fileTypeDesc' 	: 	'Image Files',
        'fileTypeExts' 	: 	'*.jpg; *.png',
        'swf'			: 	'__PUBLIC__/Style/Common/uploadify/uploadify.swf',
        'uploader'		: 	'__MODULE__/Upload/uploadOne',
        'onUploadSuccess'	: function(data, res){
        	
        	var url = eval("(" + res + ")").extra.url;
        	$("#pic-image").attr("src", url);
        	$("#pic").val( url );
        	
        }
    });
});
</script>

<!-- ueditor -->
<link rel="stylesheet" href="/ue/themes/default/css/ueditor.min.css">
<script type="text/javascript" src="/ue/ueditor.config.js"></script>
<script type="text/javascript" src="/ue/ueditor.all.js"></script>
<script type="text/javascript">
	window.UEDITOR_HOME_URL = "/ue/";
    
    var editor = UE.getEditor("content",{
    	initialFrameWidth: "100%",
	    initialFrameHeight: 300,
	    textarea: "content"
    });
    
</script>